﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="user_admin.aspx.cs" Inherits="_1.test.com.demo_1" %>
<!-- #include File="inc/inc_head.html" -->
<body>
	<div class="easyui-tabs" data-options="fit:true,border:false">
		<div title="用户管理" style="padding:20px;overflow:auto;">
			<div style="margin-top:5px;">
				<div id="stypestate" style="">
					<h2 class="h1">用户管理</h2>
					<div class="admin_table mb10">
						<table id="user_list_dataTable"></table>
					</div>
					<div>
						<span>请选择列表，然后再操作。</span>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div style="display: none">
		<div id="tb" style="padding:5px;height:auto">
			<div style="margin-bottom:5px">
				<a href="./adduser_admin.aspx" class="easyui-linkbutton" iconCls="icon-add" plain="true">添加用户</a>
				<a href="#" class="easyui-linkbutton" id="edit_user_action" iconCls="icon-edit" plain="true">编辑选中用户信息</a>
				<!-- a href="#" class="easyui-linkbutton" id="delete_food_action"  iconCls="icon-remove" plain="true">删除菜单</a -->
			</div>
			<!--<div>
			用户名:
			<input class="easyui-validatebox" name="user_name" data-options="validType:'length[1,10]'">
			<a href="#" class="easyui-linkbutton" iconCls="icon-search">查询</a>
			</div>-->
		</div>
	</div>
	<script type="text/javascript">
	    $(function () {
	        $('#user_list_dataTable').datagrid({
	            // url : './index.php?at=food&st=get_list&code=json',
	            singleSelect: 1,
	            collapsible: 0,
	            pagination: 1,
	            pageSize: 15,
	            toolbar: '#tb',
	            remoteSort: false,
	            columns: [[{
	                field: 'id',
	                title: '编号',
	                width: 60
	            }, {
	                field: 'cook_name',
	                title: '用户名',
	                width: 120,
	                sortable: 1
	            }, {
	                field: 'restaurant_name',
	                title: '性别',
	                width: 120,
	                sortable: 1
	            }, {
	                field: 'cook_price',
	                title: '电话号码',
	                width: 80
	            }, {
	                field: 'raw_add_time',
	                title: '学历',
	                width: 160
	            }, {
	                field: 'hidden_flag',
	                title: '权限',
	                width: 160
	            }]]
	        });

	        $("#edit_user_action").click(function () {
	            var _data = $('#user_list_dataTable').datagrid('getSelections');
	            if (_data.length == 0) {
	                alert('请先选择需要操作的数据！');
	                return false;
	            }

	            window.location.href = './index.php?at=food&st=edit&id=' + _data[0].id;
	            return false;
	        });
	        $("#delete_food_action").click(function () {
	            var _data = $('#user_list_dataTable').datagrid('getSelections');
	            if (_data.length == 0) {
	                alert('请先选择需要操作的数据！');
	                return false;
	            } else {
	                $.messager.confirm('警告', '是否删除此用户?', function (r) {
	                    if (r) {
	                        window.location.href = './index.php?at=food&st=list_delete&id=' + _data[0].id;
	                        return false;
	                    }
	                });
	            }

	        });
	    })
	</script>
</body>
<!-- #include File="inc/inc_foot.html" -->